package JackSu.project_model.singletom;


import org.apache.commons.lang3.SerializationUtils;

public class ProjectModelRun {

    private static void singletonTest() {
        Singleton singleton = Singleton.getLazySingleton();
        System.out.println(singleton);

        Singleton hungrySingleton = Singleton.getHungrySingleton();
        System.out.println(hungrySingleton);

        Singleton factorySingleton = Singleton.getFactorySingleton();
        byte[] serialize = SerializationUtils.serialize(factorySingleton);
        Singleton deserialize = SerializationUtils.deserialize(serialize);
        System.out.println(factorySingleton == deserialize);

        System.out.println(Singleton.SingletonEnum.SINGLETON.getName());
    }

    public static void main(String[] args) {
        singletonTest();
    }
}
